<div id='breadcrumbs'>
	<?php $this->widget('zii.widgets.CBreadcrumbs', array(
		'homeLink' => CHtml::link('All tables', 'index.html'),
		'links'=>array(
			$table->table_name,
		),
	)); ?>
</div>
<div class='table mgb10' id='<?php echo $table->table_name?>'>
	<h2><?php echo $table->table_name?></h2>
	<table class='list'>
		<tr>
			<td bgcolor=#f9f9f9 width=120>最后修改时间</td>
			<td><?php echo $table->last_update?></td>
		</tr>
		<tr>
			<td bgcolor=#f9f9f9>最后修改人</td>
			<td><?php echo $table->last_updater?></td>
		</tr>
		<tr>
			<td bgcolor=#f9f9f9>包名</td>
			<td><?php echo $table->package?></td>
		</tr>
		<tr>
			<td bgcolor=#f9f9f9>版本</td>
			<td><?php echo $table->update_count?></td>
		</tr>
		<tr>
			<td bgcolor=#f9f9f9>注释</td>
			<td><?php echo $table->comment?></td>
		</tr>
	</table>
	<div class='table-desc'><?php echo CHtml::value($table, 'description', '(无)')?></div>
	<h3>Table columns</h3>
	<?php if($table->getHasPhysicsTable()):?>
	<table class='table-columns list'>
		<tr class='thead-tr'>
			<td width=30></td>
			<td width=100>字段名</td>
			<td width=150>注释</td>
			<td width=120>数据类型</td>
			<td width=50>长度</td>
			<td width=50>允许空</td>
			<td width=50>默认</td>
			<td width=40>主键</td>
			<td width=40>外键</td>
			<!-- <td width=40>自增</td>  -->
		</tr>
		<?php $index=0?>
		<?php foreach($table->columns as $column):?>
		<tr id='<?php echo $column->name?>' <?php if($column->autoIncrement):?>class='increment' title='auto increment'<?php endif?>>
			<td align=center><?php echo ++$index?></td>
			<td><?php echo $column->name?></td>
			<td><?php echo $column->comment?></td>
			<td><?php echo $column->dbType?></td>
			<td><?php echo $column->size?></td>
			<td align=center><?php echo $column->allowNull ? 'Y' : 'N'?></td>
			<td><?php echo $column->defaultValue?></td>
			<td align=center><?php echo $column->isPrimaryKey ? 'Y' : 'N'?></td>
			<td align=center><?php echo $column->isForeignKey ? 'Y' : 'N'?></td>
		</tr>
		<?php endforeach?>
	</table>
	<?php else:?>
	<table class='list'>
		<tr>
			<td><div class='history-content'><div class='error'><i>(物理数据表不存在)</i></div></div></td>
		</tr>
	</table>
	<?php endif?>
	<h3>Update history</h3>
	<table class='list'>
		<tr><td>
			<?php foreach($table->history as $history):?>
			<div class='history-content'>
				<h4>&gt;&gt; <?php echo $history->author?> updated by <?php echo $history->create_time?></h4>
				<div class='history-remark'><?php echo CHtml::decode($history->remark ? $history->remark : '<i>(还未添加任何备注信息)</i>')?></div>
			</div>
			<?php endforeach?>
		</td></tr>
	</table>
</div>